(function($){

	$('#btn_list').click(function(){
		location.href = $PATH;
	});
	$('#btn_new').click(function(){
		popup($PATH+'edit/', 750, 560, 'ue');
	});

	/***************************************************************
	 * 
	 **************************************************************/

	WdListManager.prototype.draw = function(json)
	{
		var tag = [];
		tag.push('<td class="tc to">'+json.no+'</td>');
		tag.push('<td class="tc to">'+json.to+'</td>');
		tag.push('<td class="">'+json.title+'</td>');
		tag.push('<td class="tc to">'+json.insert_time+'</td>');
		return tag.join("");
	};
	WdListManager.prototype.draw_event = function()
	{
		$(this.root+'>tbody>tr').map(function(){
			var self = $(this);
			self.find('.edit').click(function(){
				popup($PATH+'edit/'+self.find(':checkbox').val(), 750, 560, 'ue');
			});
		});
	};
	
	$(document).ready(function(){
		wlm = new WdListManager($PATH);
		wlm.set_root('#listTable');
		wlm.set_totalbox('#listTable #total');
		wlm.set_pagebar('#listTable #pagebar');
		wlm.preload();
	});
})(jQuery);